/**
@author		Jong Min, Lee
@date		  02/12/2014
@breif		study view layout property

copyright(c) Tae Young Soft. All right reserved. 2014
*/
#pragma once

#include <vector>
#include "Taurus_Util/TUTypes.h"
#include "Taurus_Util/Macros.h"

class CStudyViewLayoutProperty
{
public:
  static const C2DLayout theDefault;

private:
  DISALLOW_COPY_AND_ASSIGN(CStudyViewLayoutProperty);

  enum 
  {
    MAX_NUM_STUDY_VIEW_ROWS = 2,
    MAX_NUM_STUDY_VIEW_COLS = 2
  };

public:
  /**
  @brief		default contructor
  */
  CStudyViewLayoutProperty();

  /**
  @brief		destructor
  */
  ~CStudyViewLayoutProperty();

  /**
  @brief		configure study view layout
  @return		ERROR_SUCCESS upon success, an error code otherwise
  */
  DWORD doConfigure();

  /**
  @brief		get the number of layouts
  @return		the number of study view layouts
  */
  inline unsigned int getNumLayouts() const
  {
    return m_theLayouts.size();
  }

  /**
  @brief		access a layout
  @param		index the index number of monitor
  @return		pointer to layout if found, NULL if not
  */
  const C2DLayout* getLayout(const unsigned int index) const;

  /**
  @brief		set study view layout
  @param		index the index number of monitor
  @return		ERROR_SUCCESS if succeedsa, an error code otherwise
  */
  DWORD setLayout(const unsigned index, const C2DLayout& layout);

  /**
  @brief		get the number of available study view layout
  @return		the number of avaible study view layout
  */
  inline unsigned int getNumAvailableLayout() const
  {
    return m_theAvailableLayouts.size();
  }

  /**
  @brief		access to an available study view layout
  @param		index the index number of available study view layout
  @return		pointer to study view layout if found, NULL if note
  */
  const C2DLayout* getAvailableLayout(const unsigned int index) const;

  /**
  @brief		check whether study view layout is available or not
  @param		layout study view layout
  @return		TRUE if study view layout is available, FALSE if not
  */
  BOOL isAvailable(const C2DLayout& layout) const;

private:
  //study view layout for each monitor
  std::vector<C2DLayout> m_theLayouts;

  //available study view layouts
  std::vector<C2DLayout> m_theAvailableLayouts;
};